from time import sleep


def doit():
    print("doing")
    sleep(1)


def done():
    print("done")


if __name__ == '__main__':
    try:
        while True:
            doit()
    except KeyboardInterrupt:
        done()
